package router

import (
	"Data-API-MCP/backend/internal/interfaces/http/handler"

	"github.com/gin-gonic/gin"
)

// RegisterMCPRoutes 注册MCP服务相关路由
func RegisterMCPRoutes(r *gin.RouterGroup, mcpHandler *handler.MCPServiceHandler) {
	mcpGroup := r.Group("/mcp")
	{
		// MCP服务管理
		mcpGroup.POST("/services", mcpHandler.CreateService)       // 创建MCP服务
		mcpGroup.GET("/services", mcpHandler.GetServices)          // 获取MCP服务列表
		mcpGroup.GET("/services/:id", mcpHandler.GetService)       // 获取单个MCP服务
		mcpGroup.PUT("/services/:id", mcpHandler.UpdateService)    // 更新MCP服务
		mcpGroup.DELETE("/services/:id", mcpHandler.DeleteService) // 删除MCP服务

		// MCP服务监控
		mcpGroup.GET("/services/:id/status", mcpHandler.GetServiceStatus)   // 获取服务状态
		mcpGroup.GET("/services/:id/metrics", mcpHandler.GetServiceMetrics) // 获取服务指标
		mcpGroup.GET("/services/:id/logs", mcpHandler.GetServiceLogs)       // 获取服务日志

		// MCP服务配置
		mcpGroup.GET("/services/:id/config", mcpHandler.GetServiceConfig)    // 获取服务配置
		mcpGroup.PUT("/services/:id/config", mcpHandler.UpdateServiceConfig) // 更新服务配置
		mcpGroup.POST("/services/:id/reload", mcpHandler.ReloadService)      // 重载服务配置
	}
}
